<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

$dictionary['grp_cities_users'] = array (
        'true_relationship_type' => 'many-to-many',
	'table' => 'grp_cities_users',

	'fields' => array (
		array (
			'name' => 'id',
			'type' => 'varchar',
			'len' => '36',
		),
		array (
			'name' => 'grp_city_id',
			'type' => 'varchar',
			'len' => '36',
		),
		array (
			'name' => 'user_id',
			'type' => 'varchar',
			'len' => '36',
		)
      , array ('name' => 'date_modified','type' => 'datetime'),
		array (
			'name' => 'deleted',
			'type' => 'bool',
			'len' => '1',
			'default' => '0'
		),
	),

	'indices' => array (
		array (
			'name' => 'grp_cities_userspk',
			'type' => 'primary',
			'fields' => array ( 'id' )
		),
		array (
			'name' => 'idx_grp_city_id',
			'type' => 'index',
			'fields' => array ('grp_city_id')
		),
		array (
			'name' => 'idx_grpuser_id',
			'type' => 'index',
			'fields' => array ('user_id')
		),
		array('name' => 'idx_grp_cities_users', 'type'=>'alternate_key', 'fields'=>array('grp_city_id','user_id'))
	),
	'relationships' => array (
            'grp_cities_users' => array(
                'lhs_module'=> 'grp_cities',
                'lhs_table'=> 'grp_cities',
                'lhs_key' => 'id',
                'rhs_module'=> 'Users',
                'rhs_table'=> 'users',
                'rhs_key' => 'id',
                'relationship_type'=>'many-to-many',
                'join_table'=> 'grp_cities_users',
                'join_key_lhs'=>'grp_city_id',
                'join_key_rhs'=>'user_id')
            ),

)
?>